/*
 * ProgressBar.fx
 *
 * Created on 17-apr-2009, 10:43:06
 */

package fotoboek.assets;

/**
 * @author r.mohammadi
 */

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

public class ProgressBar extends CustomNode {

    public var progress:Number = 0.0;
    public var width = 220;

    var progressBG : Rectangle = Rectangle {
        x: 0
        y: 0
        width: bind width
        height: 5
        fill: Color.WHEAT
        arcWidth: 5
        arcHeight: 5
    }

    var progressBar : Rectangle = Rectangle {
        x: 0
        y: 1
        height: 3
        arcWidth: 5
        arcHeight: 5
        width: bind ((width * progress)/100.0)
        fill: Color.BLACK
    }

    override function create() : Node {
        blocksMouse = true;
        Group {
            content: [ progressBG, progressBar ]
        }
    }
}